package com.check.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.check.dao.PersonRoleDao;
import com.check.pojo.Opr;

@Repository("personRoleDao")
public class PersonRoleDaoImpl  extends BaseSqlMapDao implements PersonRoleDao{

	public Opr findRoleByOprId(String oprId) {
		return (Opr) getSqlMapClientTemplate().queryForObject("Opr.findRoleByOprId",oprId);
	}

	public void insertPersonRole(Opr opr) {
		insertObject("Opr.insertOprRole", opr);
	}

	public void deletePersonRole(String oprId) {
		deleteObject("Opr.deleteOprRole", oprId);
	}
	
	public void deletePersonOfRole(String roId){
		deleteObject("Opr.deleteOprOfRole", roId);
	}

	public void deletePersonDept(String oprId) {
		deleteObject("Opr.deleteOprOrg", oprId);
		
	}

	public void insertPersonOrg(Opr opr) {
		insertObject("Opr.insertOprOrg", opr);
	}

	public void insertPersonOpr(Opr opr) {
		insertObject("Opr.insertOprManager", opr);
	}

	public void updatePersonOpr(Opr opr) {
		updateObject("Opr.updateOprManager", opr);
	}

	public void deleteOprOrgByOprIdAndOrgId(Opr opr) {
		deleteObject("Opr.deleteOprSimpleOrg", opr);
		
	}

	public List<Opr> findAllRoleByOrgId(String orgId) {
		return getSqlMapClientTemplate().queryForList("Opr.findAllRoleByOrgId",orgId);
	}
}
